<?php

namespace App\Http\Controllers;


use App\Exceptions\BusException;
use App\Http\Responses\Enum\AuthExceptionEnum;
use App\Http\Responses\RespString;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ExampleController extends Controller
{
    /**
     * 测试方法！！！！
     * @param Request $request
     * @return JsonResponse
     * @throws BusException
     */
    public function test(Request $request): JsonResponse
    {
        if ($request->input('test', false)) {
            throw new BusException(AuthExceptionEnum::NOT_AUTHORIZATION);
        } else {
            return jResp(RespString::LOGIN_SUCCESS);
        }
    }
}
